#!/usr/bin/perl

use strict;
use warnings;

Test->new->run;

package Test;

use strict;
use warnings;
use CGI::Ajax;
use base qw(CGI::Application);

sub setup{
    my ($self) = @_;
    $self->run_modes(
        AUTOLOAD => \&test,
    );
}

sub test{
    my ($self) = @_;
    my $ajx = CGI::Ajax->new(
        test => \&hallo,
        skip_header => 1,
    );
    # alternativly
    $ajx->skip_header(1);
    my $html = do{ local $/; <DATA> };
    return $ajx->build_html( $self->query, $html );
}

__DATA__
<html>
<head>
</head>
</html>
